<% form_for(@task) do |f| %>
  <%= f.error_messages %>
  <i>* = campo requerido</i>
 <table>
  <tr>
    <td class="inColumn">
      <%= f.label :name, "Nombre de actividad *"%><br />
    </td>
    <td>
      <%= f.text_field :name %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= f.label :descripcion, "Descripción *"%><br />
    </td>
    <td>
      <%= f.text_area :descripcion , :cols=>35, :rows => 3%>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= f.label :start_date, "Fecha planeada de inicio *" %><br />
    </td>
    <td>
		<%= calendar_date_select_tag 'task[start_date]',@task.start_date,
                :popup => 'force',
		:year_range => 1.years.ago..10.years.from_now,
		:size => 10,
                :onchange=>"document.getElementById('task[current_start_date]').value=this.value"
		%>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= f.label :end_date, "Fecha planeada de término *" %><br />
    </td>
    <td>
		<%= calendar_date_select_tag 'task[end_date]',@task.end_date,
                :popup => 'force',
		:year_range => 1.years.ago..10.years.from_now,
		:size => 10,
                :onchange=>"document.getElementById('task[current_end_date]').value=this.value"
		%>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= f.label :current_start_date, "Fecha actual de inicio*" %><br />
    </td>
    <td>
		<%= calendar_date_select_tag 'task[current_start_date]',@task.end_date,
                :popup => 'force',
		:year_range => 1.years.ago..10.years.from_now,
		:size => 10
		%>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= f.label :end_date, "Fecha actual de termino *" %><br />
    </td>
    <td>
		<%= calendar_date_select_tag 'task[current_end_date]',@task.end_date,
                :popup => 'force',
		:year_range => 1.years.ago..10.years.from_now,
		:size => 10
		%>
    </td>
  </tr>

  <tr>
    <td class="inColumn">
        <%= f.label :percentage, "Porcentage [ 0 - 100 ]" %><br />
    </td>
    <td>
        <%= f.text_field :percentage, :size=>'3' %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
        <%= f.label :status, "Estado" %><br />
    </td>
    <td>
                <select name="task[status]"   >
                  <%if (!@task.status.nil?)%>
                    <option value="<%= @task.status %>" >
                        <%= @task.status %>
                    </option>
                 <%end%>
                    <option value="Nuevo">
                            Nuevo
                    </option>
                    <option value="En proceso">
                        En proceso
                    </option>
                    <option value="Completado">
                        Completado
                    </option>
                </select>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
        <%= f.label :project_id, "Pertenece al proyecto"%><br />
    </td>
    <td>
        <%= select_project %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
        <%= f.label :user_id, "Asignado al usuario" %><br />
    </td>
    <td>
        <%= select_user %>
    </td>
  </tr>
 </table><br/><br/>
    <%= f.submit 'Guardar' %>
    <%= f.submit 'Cancelar' %>
<% end %>
